package cn.smileyan.demos.operators;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 例子1：flink 的 map 例子
 * @author smileyan
 */
public class MapDemo {
    public static void main(String[] args) throws Exception {
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStream<String> fixedInput = env.fromElements(
                "apple",
                "banana",
                "cherry",
                "date",
                "elderberry");

        DataStream<String> uppercased = fixedInput.map(String::toUpperCase);

        uppercased.print();

        env.execute("Flink Map Example with Fixed Data");
    }
}
